#!/usr/bin/env sh

cd "$(dirname "$0")"
. "./.common.sh"
cd ../..

tester="./support/tools/test"

if ! chkcmd 'brew'; then
        echo ' "brew" command not found.'
        echo ' Skipping version based testing for PHP {5.6, 7}.'

        "$tester"
else
        brew unlink php56 php70 > /dev/null     \
        && brew link php56      > /dev/null     \
        && printf "\nTesting against PHP 5.6\n" \
        && "$tester"                            \
        && clear                                \
        && brew unlink php56    > /dev/null     \
        && brew link php70      > /dev/null     \
        && printf "\nTesting against PHP 7.0\n" \
        && "$tester"
fi
